<div class="contact-form-container">
  <%if params[:user_status]!=0 -%>
    <div class="get-more-info">
      <%=image_tag "get-more-info.jpg",:align=>"left",:width=>"25px",:height=>"25px",:border=>"0px" -%>&nbsp;&nbsp;Get More Information
    </div>
    <div class="form-tabs">
      <ul>
          <li class="selected-form-tab">
            <a href="">
            <%=image_tag "email-and-sms.png", :height=>"25",:border=>"0px",:align=>"absmiddle" -%>
                &nbsp;&nbsp;E-mail and SMS
                </a>
          </li>
        <li><a href="">
           <%=image_tag "get-phone-number.png", :height=>"25",:border=>"0px",:align=>"absmiddle" -%>
            &nbsp;&nbsp;Get Phone Number</a></li>
      </ul>
    </div>
    <div class="form">
    	<div class="form-user-type" <%if params[:s_status]=="1" -%> style="display:none;" <%end-%>>
            <input type="radio" name="user_status" value="new" checked="checked" onclick="$('existing_user').style.display='none';$('new_user').style.display='block';"/> New User &nbsp;&nbsp;
            <input type="radio" name="user_status" value="existing" onclick="$('new_user').style.display='none';$('existing_user').style.display='block';" /> Existing User
    	</div>
        <div id="new_user" <%if params[:s_status]=="1" -%> style="display:none;" <%end-%>>
              <% form_tag url_for(:controller => "queries",  :action => "create" , :advertisment_id => @advertisment), :multipart => true do  %>
        <div class="form-message">
        	Contact this business with your requirements and queries.
        </div>
        <div class="form-student-or-not">Are you a student?
            <input type="radio" name="student" value="yes" checked="checked"  onclick="$('university').style.display='block';$('user_type').value='Student';"/>Yes&nbsp;&nbsp;
            <input type="radio" name="student" value="no" onclick="$('university').style.display='none';$('user_type').value='NonStudent';" />No

    	</div>
        <div class="form-inputs">
            <input id="user_type" name="user[type]" type="hidden" value="Student"/>
        	<input value="of University / College*" id="university" name="university" type="text" class="form-textbox2" maxlength="40"/>
             <%=text_field :user, :full_name ,:size => 28,:class=>"form-textbox",:value=> (session[:user].nil? ? "Your name*"  : session[:user].full_name) , :maxlength=>"40" -%>
             <%=text_field :user, :email,:size => 28,:class=>"form-textbox",:value=> (session[:user].nil? ? "E-mail ID*"  : session[:user].email)     , :maxlength=>"40" -%>
             <%=text_field :user, :mobile_no ,:size => 20,:class=>"form-textbox1",:value=> (session[:user].nil? ? "Mobile No.*" : session[:user].mobile_no) , :maxlength=>"10",:onblur=>"get_verification_box();" -%>
          	 <%=text_area :query, :content , :class=>"contact-form-textarea",:size => "55x3"  ,:wrap=> "virtual",:value=>"Message*\n\Please provide a detailed response to get a better reply"%>
        </div>
        <div class="form-attach">
            <%=link_to image_tag("Attach.jpg", :border=>"0px") + "Attach a file", "javascript:void(0);",:onclick=>"Element.show('attach-field');"-%>
        </div>
        <div class="attach-field" style="display:none;" id="attach-field">
          <%=file_field(:attachment,:file,:class=>"e-mail-id") -%>
        </div>
        <div class="form-required-fields">
        	*  required
        </div>
        <div class="form-send-message">
            <%= image_submit_tag("send-message.jpg" ,:id=>"submit_email") -%>
        </div>
          <div id="verification-box" class="verification-box" <%if @user%> <% if @user.status == 1 -%> style="display:none;" <%end -%> <%end%> style="display:none;">
            <div class="verification-text" >
                  A verification code has been sent to you through SMS. Enter the code below and click Verify.
            </div>
            <div class="enter-verify-code">
                <input type="text" class="enter-code" id="verification_code" value="Enter code" size="10" maxlength="6"/>&nbsp;&nbsp;
                <%= link_to_remote image_tag('verify-code.jpg', :alt=>"verify", :width=>"50px", :height=>"20px", :border=>"0px"),
                  :url => {:controller=>"post", :action =>"update_status",:id => @user},:with => "'verification_code=' + $('verification_code').value",
                   :update => "verification_box" -%>

                <div class="code-example">Code E.g. 67194</div>
           </div>
        </div>
	 <%end -%>
     </div>
   <div id="existing_user" style="display:none;" <%if params[:s_status]=="1" -%> style="display:none;" <%end-%>>
    <div style="border:1px solid #e1e1e1">
    <b>Your message has been sent.</b><br><br>
    You are one short step away from becoming a registered SearchMyCampus user. <br>
    Create a password below to complete your registration. <br><br>
    Why would I want to register?
    </div>
       <% form_tag(:action => "process_login", :advertisment_id => @advertisment) do %>
             <%= text_field "user", "name",:class=>"form-textbox",:value=>"Username" %>&#x00A;
             <%= password_field "user", "password",:class=>"form-textbox",:value=>"Pasword" -%>&#x00A;
              <div style="clear:both;"><%= image_submit_tag("sign-in-button.png") -%></div>
  <% end %>
  </div>
 <div class="contact-register-container" <%if params[:s_status]=="1" -%> style="display:block;" <%else%> style="display:none;" <%end-%> id="reg-step">
  <div style="border:1px solid #e1e1e1">
  <b>Your message has been sent.</b><br><br>
  We think you might be a registered user on SearchMyCampus.com. <br>
  Sign in to your account to save your replies for future use and make future replies quicker
  </div>
    <%form_tag url_for(:controller=>"queries",:action => "update")  do  -%>

        <div class="contact-register-field">
           <div  class="contact-register-text"><%=session[:register_email]-%></div>
           <input type="hidden" name="user[email]" value="<%=session[:register_email]-%>"
           <input type="hidden" name="advertisment_id" value="<%=params[:id]-%>"
          <%#=hidden_field_tag :user, :email,:size => 40,:value=> (session[:register_email].nil? ? ""  : session[:register_email]),:class=>"contact-register-container-input", :maxlength=>"40" -%>
        </div>
        <div class="contact-register-field">
          <div class="contact-register-text">Create Password:</div>
          <%=password_field :password, :original , :class=>"contact-register-container-input",:size => 40, :maxlength=>"40" -%>
        </div>
        <div class="contact-register-field">
           <div class="contact-register-text">Confirm Password:</div>
           <%=password_field :password, :confirm , :class=>"contact-register-container-input",:size => 40, :maxlength=>"100" -%>
        </div>

        <div class="contact-register-button">
           <%=image_submit_tag("registration-button.jpg")-%>
           <%=hidden_field_tag(:user_id,params[:user]) -%>
       </div>
       <!-- <div class="regitration-proceed">
            * required
        </div>-->
        <%end -%>
        </div>
</div>
<%else%>
<%#=render :partial=>"advertisments/small_verification_box" -%>
<%end -%>
</div>


